using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


namespace QLNhaSach.GUI.NhanVienQuanLy
{
    public partial class NVQuanLy : Form
    {
        public int manvql;
        public NVQuanLy()
        {
            InitializeComponent();
        }

        private void CloseAllChildForm()
        {
            Form[] frm = this.MdiChildren;
            for (int i = 0; i < frm.Length; i++)
            {
                frm[i].Close();
            }
        }

        private void NhanVienQuanLy_Load(object sender, EventArgs e)
        {
            btnTTCaNhan_Click(sender, e);
        }

       private void btnTTCaNhan_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            ThongTinCaNhan fmThongTinCaNhan = new ThongTinCaNhan();
            fmThongTinCaNhan.manvChilder = manvql;
            fmThongTinCaNhan.MdiParent = this;
            fmThongTinCaNhan.Show();
        }

        private void btnQLSach_Click(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild != null)
                this.ActiveMdiChild.Close();
            ThemThongTinKhachHang fmThemThongTinKhachHang = new ThemThongTinKhachHang();
            fmThemThongTinKhachHang.MdiParent = this;
            fmThemThongTinKhachHang.Show();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            if (this.ActiveMdiChild != null)
                this.ActiveMdiChild.Close();
            ThayDoiQuyDinh fmThayDoiQuyDinh = new ThayDoiQuyDinh();
            fmThayDoiQuyDinh.MdiParent = this;
            fmThayDoiQuyDinh.Show();
        }
     
        private void buttonX2_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            KiemTraHoaDonNhapVaXuatSach fmKiemTraHoaDonNhapVaXuatSach = new KiemTraHoaDonNhapVaXuatSach();
            fmKiemTraHoaDonNhapVaXuatSach.MdiParent = this;
            fmKiemTraHoaDonNhapVaXuatSach.Show();
        }

        private void buttonX4_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            XemHoaDonMotKhachHang fmXemHoaDonKhachHang = new XemHoaDonMotKhachHang();
            fmXemHoaDonKhachHang.MdiParent = this;
            fmXemHoaDonKhachHang.Show();
        }

        private void buttonX5_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            ThemQuyDinh fmThemQuyDinh = new ThemQuyDinh();
            fmThemQuyDinh.MdiParent = this;
            fmThemQuyDinh.Show();  
        }

        private void buttonX6_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();
        }

        private void btnDangXuat_Click(object sender, EventArgs e)
        {
            CloseAllChildForm();
            DangXuat fmDangXuat = new DangXuat();
            fmDangXuat.maNV = manvql;
            fmDangXuat.MdiParent = this;
            fmDangXuat.Show();
        }
    }
}